feat(electron-publish): add support for a read/write token to publish to a private gitlab repository#9680
Conversation
… to a private gitlab repository
|
| token = process.env.GITLAB_TOKEN || null | ||
| let token = info.token | ||
| if (isEmptyOrSpaces(token) || process.env.GITLAB_RELEASE_TOKEN) { | ||
| token = process.env.GITLAB_RELEASE_TOKEN ? process.env.GITLAB_RELEASE_TOKEN : process.env.GITLAB_TOKEN || null |
There was a problem hiding this comment.
Could you please update the GitlabOptions description about this new env var?
electron-builder/packages/builder-util-runtime/src/publishOptions.ts
Lines 168 to 170 in 96d782a
Also, is this intended to always override the GITLAB_TOKEN env var even if the RELEASE_TOKEN is present? This logic seems odd to me but at least should be described in the docs.
After updating the publishOptions.ts tsdocs, please run pnpm generate-all for the schema and site docs.
| if (isEmptyOrSpaces(token) || process.env.GITLAB_RELEASE_TOKEN) { | ||
| token = process.env.GITLAB_RELEASE_TOKEN ? process.env.GITLAB_RELEASE_TOKEN : process.env.GITLAB_TOKEN || null | ||
| if (isEmptyOrSpaces(token)) { | ||
| throw new InvalidConfigurationError(`GitLab Personal Access Token is not set, neither programmatically, nor using env "GITLAB_TOKEN"`) |
There was a problem hiding this comment.
This error message should be updated to mention the GITLAB_RELEASE_TOKEN as well.
mmaietta
left a comment
There was a problem hiding this comment.
Please also generate a changeset file via pnpm generate-changeset so this is properly picked up by the CI/CD pipeline
Using the same approach followed by
GitHubPublisher, this PR add support forGITLAB_RELEASE_TOKENtoken to be used during publishing to a private repository, where the token requires write permissions.